extends WindowDialog

onready var screen_btns = $"VBoxContainer/VBoxContainer/Screen/btnFull"
onready var bgm_varLab = $"VBoxContainer/VBoxContainer/BGM/valLab"

# 设置字典 -- 后期与外部设置文件对应
var gameSettings = {
	screen_mode = "FullScreen", # 屏幕显示模式（全屏或者窗口）
	bgm = { # BGM
		mute = false, # - 是否关闭
		volume = 30 # - 音量
	},
	game_speed = 1
}

func _on_Button_pressed():
	var screen_btn_name = screen_btns.group.get_pressed_button().name
	gameSettings.screen_mode = get_node("VBoxContainer/VBoxContainer/Screen/" + screen_btn_name).text
	set_screen_mode(gameSettings.screen_mode)
	pass # Replace with function body.

# 设置屏幕的显示模式（全屏或者窗口）
func set_screen_mode(mode):
	OS.window_fullscreen = false
	match mode:
		"FullScreen":
			OS.window_fullscreen = true
		"720P":
			OS.window_size = Vector2(1280,720)
		"1080P":
			OS.window_size = Vector2(1920,1080)
	OS.center_window()


func _on_HSlider_value_changed(value):
	bgm_varLab.text = str(value)
	pass # Replace with function body.
